﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data;
using DB2Provider;

namespace Bussiness
{
    /// <summary>
    /// 班值类
    /// </summary>
    public class ClassValue
    {
        /// <summary>
        /// 班值编号
        /// </summary>
        public string BZID { get; set; }
        /// <summary>
        /// 班值描述
        /// </summary>
        public string BZDescription { get; set; }
        /// <summary>
        /// 返回班值结果集
        /// </summary>
        /// <returns></returns>
        public DataTable GetBZ()
        {
            string sql = "SELECT * FROM T_SYS_BZ";
            DataLink link = new DataLink();
            DataTable dt = link.ExcuteRetureTable(sql);
            return dt;
        }
        /// <summary>
        /// 返回班值描述
        /// </summary>
        /// <returns></returns>
        public string GetBZDescription()
        {
            if (BZID == "")
                return "";
            string sql = "SELECT * FROM T_SYS_BZ WHERE BZID='" + BZID + "'";
            DataLink link = new DataLink();
            string bzDesc = link.GetFirstValue(sql).ToString();
            return bzDesc;
        }
        /// <summary>
        /// 返回班值描述
        /// </summary>
        /// <param name="bzid">班值编号</param>
        /// <returns></returns>
        public string GetBZDescription(string bzid)
        {
            if (bzid == "")
                return "";
            string sql = "SELECT * FROM T_SYS_BZ WHERE BZID='"+bzid+"'";
            DataLink link = new DataLink();
            string bzDesc = link.GetFirstValue(sql).ToString();
            return bzDesc;
        }
    }
}
